import {createRouter,createWebHistory }from 'vue-router'


import loginvue from "@/views/login.vue"
import layoutvue from "@/views/layout.vue"
import ArticlelistVue from '@/views/Articlelist.vue'
import ArticleManageVue from '@/views/ArticleManage.vue'
import UseraddVue from '@/views/Useradd.vue'
import UserResetPasswordVue from '@/views/UserResetPassword.vue'
import UserInfoVue from '@/views/UserInfo.vue'

//定义路由关系
const routes =[
{
    path:'/login',component :loginvue
    
}
,
{
    path:'/',component :layoutvue,children:[{
        path:'/article/list',component :ArticlelistVue
    }
    ,
    {
        path:'/article/manage',component :ArticleManageVue
    }
    ,
    {
        path:'/user/register',component :UseraddVue
    }
    ,
    {
        path:'/user/updatePwd',component :UserResetPasswordVue
    }
    ,
    {
        path:'/user/userInfo',component :UserInfoVue
    }]
}




]

//创建路由
const router =createRouter(
    {
        history:createWebHistory(),
        routes:routes
    }
)
export default router